@import './variables.scss';

// 公共容器样式
.container {
  width: 100%;
  max-width: $container-width-lg;
  margin: 0 auto;
  padding: 0 $spacing-md;

  // 响应式 手机
  @media (min-width: $breakpoint-mobile) {
    max-width: $container-width-sm;
  }

  // 响应式 平板
  @media (min-width: $breakpoint-tablet) {
    max-width: $container-width-md;
  }

  // 响应式 桌面
  @media (min-width: $breakpoint-desktop) {
    max-width: $container-width-lg;
  }

  // 响应式 大桌面
  @media (min-width: $breakpoint-large-desktop) {
    max-width: $container-width-xl;
  }

  // 响应式 超大桌面
  @media (min-width: $breakpoint-xl) {
    max-width: $container-width-2xl;
  }

  // 响应式 超大桌面
  @media (min-width: $breakpoint-2xl) {
    max-width: $container-width-3xl;
  }
}

// 弹性布局工具类
.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.align-center {
  align-items: center;
}

.align-start {
  align-items: flex-start;
}

.align-end {
  align-items: flex-end;
}

// 间距工具类
.mt-xs {
  margin-top: $spacing-xs;
}

.mt-sm {
  margin-top: $spacing-sm;
}

.mt-md {
  margin-top: $spacing-md;
}

.mt-lg {
  margin-top: $spacing-lg;
}

.mt-xl {
  margin-top: $spacing-xl;
}

.mb-xs {
  margin-bottom: $spacing-xs;
}

.mb-sm {
  margin-bottom: $spacing-sm;
}

.mb-md {
  margin-bottom: $spacing-md;
}

.mb-lg {
  margin-bottom: $spacing-lg;
}

.mb-xl {
  margin-bottom: $spacing-xl;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.py-md {
  padding-top: $spacing-md;
  padding-bottom: $spacing-md;
}

.px-md {
  padding-left: $spacing-md;
  padding-right: $spacing-md;
}

// 文本样式
.text-center {
  text-align: center;
}

.text-primary {
  color: $primary-color;
}

.text-secondary {
  color: $secondary-color;
}

.text-accent {
  color: $accent-color;
}

// 按钮样式
.btn {
  display: inline-block;
  padding: $spacing-lg/4 $spacing-sm;
  border-radius: $border-radius-sm;
  font-size: $font-size-base;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: $transition-normal;
  border: none;
  outline: none;

  &:hover {
    opacity: 0.9;
  }

  &:active {
    transform: translateY(1px);
  }
}

.btn-primary {
  background-color: $primary-color;
  color: white;
}

.btn-secondary {
  background-color: $secondary-color;
  color: white;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid $primary-color;
  color: $primary-color;

  &:hover {
    background-color: $primary-color;
    color: white;
  }
}

// 卡片样式
.card {
  background-color: $background-color;
  border-radius: $border-radius-md;
  box-shadow: $box-shadow-sm;
  padding: $spacing-lg;
  margin-bottom: $spacing-lg;
}

// 响应式图片
.img-fluid {
  max-width: 100%;
  height: auto;
}

// 隐藏元素
.hidden {
  display: none !important;
}

// 响应式显示/隐藏
.hidden-mobile {
  @media (max-width: $breakpoint-mobile ) {
    display: none !important;
  }
}

.hidden-tablet {
  @media (min-width: $breakpoint-mobile) and (max-width: $breakpoint-desktop) {
    display: none !important;
  }
}

.hidden-desktop {
  @media (min-width: $breakpoint-desktop) {
    display: none !important;
  }
}

.visible-mobile {
  @media (min-width: $breakpoint-mobile) {
    display: none !important;
  }
}

.visible-tablet {

  @media (max-width: $breakpoint-mobile),
  (min-width: $breakpoint-desktop) {
    display: none !important;
  }
}

.visible-desktop {
  @media (max-width: $breakpoint-desktop) {
    display: none !important;
  }
}